﻿using System;

namespace YJKRevitStairs.HYElevator.DataInfo
{
	internal class MatchType
	{
		public static ElevatorType GetElevatorType(string strType)
		{
			if (strType.Trim().Equals("客梯"))
			{
				return ElevatorType.ELEVATOR;
			}
			if (strType.Trim().Equals("住宅梯"))
			{
				return ElevatorType.RESLADDER;
			}
			if (strType.Trim().Equals("医梯"))
			{
				return ElevatorType.MEDICALLADDER;
			}
			if (strType.Trim().Equals("货梯"))
			{
				return ElevatorType.CARGOLIFT;
			}
			return ElevatorType.INVALID;
		}

		public static string GetElevatorType(ElevatorType SelType)
		{
			string result = string.Empty;
			switch (SelType)
			{
			case ElevatorType.ELEVATOR:
				result = "客梯";
				break;
			case ElevatorType.CARGOLIFT:
				result = "货梯";
				break;
			case ElevatorType.MEDICALLADDER:
				result = "医梯";
				break;
			case ElevatorType.RESLADDER:
				result = "住宅梯";
				break;
			}
			return result;
		}

		public static DoorType GetDoorType(string strDoor)
		{
			if (strDoor.Trim().Equals("中分"))
			{
				return DoorType.MIDTYPE;
			}
			if (strDoor.Trim().Equals("旁开"))
			{
				return DoorType.SIDETYPE;
			}
			return DoorType.INVALID;
		}

		public static string GetDoorType(DoorType SelDoorType)
		{
			string result = string.Empty;
			if (SelDoorType == DoorType.SIDETYPE)
			{
				result = "旁开";
			}
			else if (SelDoorType == DoorType.MIDTYPE)
			{
				result = "中分";
			}
			return result;
		}

		public static BlanceWeightPos GetBPos(string strBPos)
		{
			if (strBPos.Trim() == "左置")
			{
				return BlanceWeightPos.BALLEFT;
			}
			if (strBPos.Trim() == "右置")
			{
				return BlanceWeightPos.BALRIGHT;
			}
			return BlanceWeightPos.BALBEHIND;
		}

		public static string GetBPos(BlanceWeightPos SelBPos)
		{
			string result = string.Empty;
			switch (SelBPos)
			{
			case BlanceWeightPos.BALBEHIND:
				result = "后置";
				break;
			case BlanceWeightPos.BALRIGHT:
				result = "右置";
				break;
			case BlanceWeightPos.BALLEFT:
				result = "左置";
				break;
			}
			return result;
		}
	}
}
